import { CoolValidateException } from "@cool-midway/core"
import { Rule, RuleType } from "@midwayjs/validate"

/**
 * 新增退款配置DTO
 */
export class AddProductRefundConfigDTO {
    @Rule(RuleType.number().required().error(new CoolValidateException('请输入产品ID')))
    productId: number
    @Rule(RuleType.allow('fixed', 'percentage').required().error(new CoolValidateException('请输入退款类型')))
    type: 'fixed' | 'percentage'
    @Rule(RuleType.number().required().error(new CoolValidateException('请输入退款金额或比例')))
    value: number
}